package com.app.util.database.mybatis;

import java.io.Serializable;

public class QueryField implements Serializable{

	
	
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private String field ;			//属性
	
	private String mark	;			//操作符号
	
	private Object fieldValue ;		//值
	
	private Object[] fieldArray;	
	
	
	//最多支持三级联查
	private String preLinkField2Mark;	//连接第二个查询的连接符
	private String field2;
	private String mark2;
	private Object fieldValue2;
	private Object[] fieldArray2;
	
	private String preLinkField3Mark;	//连接第三个查询的连接符
	private String field3;
	private String mark3;
	private Object fieldValue3;
	private Object[] fieldArray3;
	
	
	
	public QueryField(){}
	
	public QueryField(String field,String mark,Object fieldValue){
		this.field = field;
		this.mark = mark;
		this.fieldValue = fieldValue;
	}
	
	/**
	 * 添加第1个查询条件
	 * @param queryLinkType
	 * @param field2
	 * @param mark2
	 * @param fieldValue2
	 */
	public void setFirstQuery(String field,String mark,Object fieldValue) {
		this.field = field;
		this.mark = mark;
		this.fieldValue = fieldValue;
	}
	
	/**
	 * 添加第二个查询条件
	 * @param queryLinkType
	 * @param field2
	 * @param mark2
	 * @param fieldValue2
	 */
	public void setSecondQuery(QueryLinkType queryLinkType,String field2,String mark2,Object fieldValue2) {
		this.preLinkField2Mark = queryLinkType.getCode();
		this.field2 = field2;
		this.mark2 = mark2;
		this.fieldValue2 = fieldValue2;
	}
	
	/**
	 * 添加第三个查询条件
	 * @param queryLinkType
	 * @param field3
	 * @param mark3
	 * @param fieldValue3
	 */
	public void setThirdQuery(QueryLinkType queryLinkType,String field3,String mark3,Object fieldValue3) {
		this.preLinkField3Mark = queryLinkType.getCode();
		this.field3 = field3;
		this.mark3 = mark3;
		this.fieldValue3 = fieldValue3;
	}
	
	public Object[] getFieldArray() {
		return fieldArray;
	}

	public void setFieldArray(Object[] fieldArray) {
		this.fieldArray = fieldArray;
	}

	public String getPreLinkField2Mark() {
		return preLinkField2Mark;
	}

	public void setPreLinkField2Mark(String preLinkField2Mark) {
		this.preLinkField2Mark = preLinkField2Mark;
	}

	public String getField2() {
		return field2;
	}

	public void setField2(String field2) {
		this.field2 = field2;
	}

	public String getMark2() {
		return mark2;
	}

	public void setMark2(String mark2) {
		this.mark2 = mark2;
	}

	public Object getFieldValue2() {
		return fieldValue2;
	}

	public void setFieldValue2(Object fieldValue2) {
		this.fieldValue2 = fieldValue2;
	}

	public Object[] getFieldArray2() {
		return fieldArray2;
	}

	public void setFieldArray2(Object[] fieldArray2) {
		this.fieldArray2 = fieldArray2;
	}

	public String getPreLinkField3Mark() {
		return preLinkField3Mark;
	}

	public void setPreLinkField3Mark(String preLinkField3Mark) {
		this.preLinkField3Mark = preLinkField3Mark;
	}

	public String getField3() {
		return field3;
	}

	public void setField3(String field3) {
		this.field3 = field3;
	}

	public String getMark3() {
		return mark3;
	}

	public void setMark3(String mark3) {
		this.mark3 = mark3;
	}

	public Object getFieldValue3() {
		return fieldValue3;
	}

	public void setFieldValue3(Object fieldValue3) {
		this.fieldValue3 = fieldValue3;
	}

	public Object[] getFieldArray3() {
		return fieldArray3;
	}

	public void setFieldArray3(Object[] fieldArray3) {
		this.fieldArray3 = fieldArray3;
	}

	
	
	public String getField() {
		return field;
	}

	public void setField(String field) {
		this.field = field;
	}

	public String getMark() {
		return mark;
	}

	public void setMark(String mark) {
		this.mark = mark;
	}

	public Object getFieldValue() {
		return fieldValue;
	}

	public void setFieldValue(Object fieldValue) {
		this.fieldValue = fieldValue;
	}

	
	
	public static void main(String[] args) {
		Object o = new String[] {"a1","a2","a3"};
		
		Object o1 = new int[] {1,2,3};
		
		Object o2 = new Integer[] {1,2,3};
		
		System.out.println(o.getClass() == String[].class);
		
		System.out.println(o1.getClass() == int[].class);
		
		System.out.println(o2.getClass() == Integer[].class);
		
		
		
		
	}
	

}
